package minidraw.framework;

import java.awt.*;
import java.util.EventObject;

/** The change event originating from a drawing.

    This code is copied literally from JHotDraw 5.1
*/
public class DrawingChangeEvent extends EventObject {
	private static final long serialVersionUID = 65431234678898911L;

    private Rectangle fRectangle;

    /**
     *  Constructs a drawing change event.
     */
    public DrawingChangeEvent(Drawing source, Rectangle r) {
        super(source);
        fRectangle = r;
    }

    /**
     *  Gets the changed drawing
     */
    public Drawing getDrawing() {
        return (Drawing)getSource();
    }

    /**
     *  Gets the changed rectangle
     */
    public Rectangle getInvalidatedRectangle() {
        return fRectangle;
    }
}
